from app.views.ClasView import ClasView# 新增
from app.views.StudentView import StudentView
class MainView:
    def __init__(self):
        self.function_list = ["班级管理", "学生管理"]
        self.clas_view = ClasView()
        self.student_view = StudentView()# 新增
    def display_menu(self):
        print("\n============== 学生成绩管理系统 ==============")
        for idx, func in enumerate(self.function_list):
            print(f"  {idx + 1}. {func}")
        print("  q. 退出系统")
        print("请根据上面的选项输入数字并按回车继续...")

    def run(self):
        while True:
            self.display_menu()
            choice = input("请输入操作符：")
            if choice == "q":
                break
            elif choice == "1":
                self.clas_view.run()          # 新增
            elif choice == "2":
                self.student_view.run()
            else:
                print("请输入正确的操作符")